Skip to content

Add support for multiple languages with configurable translations. Updated README with configuration instructions - #157

Open
tubby1981 wants to merge 31 commits into
ubccr:mainfrom
tubby1981:main
Open

Add support for multiple languages with configurable translations. Updated README with configuration instructions#157
tubby1981 wants to merge 31 commits into
ubccr:mainfrom
tubby1981:main

Conversation

@tubby1981

Copy link
Copy Markdown

Translations

mokey supports multiple languages for its interface and email templates.

To configure translations:

  1. Place translation files in /etc/mokey/translations/. For example:
  • english.toml for English translations
  • dutch.toml for Dutch translations
  1. Update the configuration file /etc/mokey/mokey.toml with the following options:

#Default language for the site
#Languages supported: English (english), Dutch (dutch)
#Default is english
default_language = "dutch"

#Directory where translations can be placed
translations_dir = "/etc/mokey/translations"`

Users can translate mokey into their own language by creating a new .toml file in the translations_dir and referencing it in the default_language configuration. This allows for complete customization of the interface and email templates in the preferred language.

root and others added 30 commits January 6, 2025 19:23
…dated README with configuration instructions
…dated README with configuration instructions
Show Org Unit (read-only) and Telephone Number (read-only) on the account
settings page. Allow users to edit Job Title and Mobile Telephone Number.
Depend on tubby1981/goipa v0.0.8 via go.mod replace for ou/title support.
Rename packaged translation files to dutch.toml and english.toml.
Redirect expired logins to forgot-password, add timeout error templates,
harden error logging and favicon startup, and document email logo_path.
Use generic email titles, footer text, and logo.png paths. Generalize
gitignore patterns for local template override directories.
Use FreeIPA admin passwd, correct OTP/error handling, and vendored goipa with AdminSetPassword.
Use ResetPassword+SetPassword as primary flow and refresh krbPasswordExpiration from pwpolicy maxlife on admin passwd fallback.
Fall back to global_policy for maxlife, warn instead of failing after admin passwd, and use an anonymous client for self-service SetPassword.
Use ChangePassword after random reset, pwpolicy_find fallbacks, and accounts.password_max_life_days config.
Use pwpolicy min length and character classes per user with mokey.toml fallbacks.
HTMX did not always include browser-autofilled values in POST bodies, causing
users to repeat the username step. Read input values from the DOM before submit
and improve login form autocomplete semantics for password managers.
Support one-step login when username and password are posted together,
strip credentials from auth URL query strings, accept CSRF via hidden form
field, and add optional server.auth_debug logging for troubleshooting.
The link was only shown on the password step after consolidating username
and password onto one screen.
neverlless added a commit to neverlless/mokey that referenced this pull request Aug 15, 2026
Based on upstream PR ubccr/mokey#157 by @tubby1981, reimplemented on the
current codebase. English and Dutch translation files (contributed in
that PR) are embedded in the binary; site.default_language selects the
language and site.translations_dir allows adding or overriding languages
with <language>.toml files. Missing keys fall back to English.

All templates, handler messages, and email subjects/bodies now go
through the T() translation function.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant